package com.kingyun.gpsinspection.purificationservice.services.jsm.innerservice.impl.device;

import com.kingyun.gpsinspection.purificationservice.dao.mapper.jsm.DeviceExpandMapper;
import com.kingyun.gpsinspection.purificationservice.facade.model.jsm.DeviceExpand;
import com.kingyun.gpsinspection.purificationservice.facade.service.jsm.device.JsmDeviceExpandService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * 生产设备特性ServiceImpl
 * @author zjh
 * @since 20170301
 */

public class JsmDeviceExpandServiceImpl implements JsmDeviceExpandService {

    private Logger logger= LoggerFactory.getLogger(JsmDeviceExpandServiceImpl.class);

    @Autowired
    private DeviceExpandMapper deviceExpandMapper;
    /**
     * 新增生产设备特性
     *
     * @param deviceExpand
     * @return
     */
    @Override
    @Transactional(propagation = Propagation.REQUIRED)
    public int addDeviceExpand(DeviceExpand deviceExpand) {
        return deviceExpandMapper.insert(deviceExpand);
    }

    /**
     * 更新生产设备
     *
     * @param deviceExpand
     * @return
     */
    @Override
    @Transactional(propagation = Propagation.REQUIRED)
    public int updateDeviceExpand(DeviceExpand deviceExpand) {
        return deviceExpandMapper.updateDeviceExpand(deviceExpand);
    }

    /**
     * 得到设备的生产特性
     *
     * @param deviceId
     * @return
     */
    @Override
    public DeviceExpand getDeviceExpandByDeviceId(String deviceId) {
        return deviceExpandMapper.getDeviceExpandByDeviceId(deviceId);
    }
}
